$(document).ready(function(){
    
	$('#isi').load('monitoring.php');
	$("ul#menu_parent li a, ul#menu_parent li > ul li a").click(function() {

        var hal = $(this).attr('href');
        if (hal === '') {
            return false;
        } 
        $('#isi').load(hal + '.php');
        return false;
    });

    $.getJSON('controller/cont.login.php',{aksi_user_menu:true},function(data){
        $('#nip_logged').html(data.nip);
        $('#kewenangan_logged').html(data.kewenangan);
        if(data.id_kewenangan==='5'){
            document.getElementById("proses").style.display="none";
            document.getElementById("usulan").style.display="none";
            document.getElementById("usulan_kppn").style.display="block";
        }
        if(data.id_kewenangan==='3'){
            document.getElementById("proses").style.display="none";
            document.getElementById("usulan").style.display="block";
            document.getElementById("usulan_kppn").style.display="none";
        }
        if(data.id_kewenangan==='2'){
            document.getElementById("proses").style.display="block";
            document.getElementById("usulan").style.display="none";
            document.getElementById("usulan_kppn").style.display="none";
        }
        if(data.id_kewenangan==='4'){
            document.getElementById("proses").style.display="none";
            document.getElementById("usulan").style.display="none";
            document.getElementById("usulan_kppn").style.display="none";
        }
        if(data.id_kewenangan==='1'){
            document.getElementById("proses").style.display="block";
            document.getElementById("usulan").style.display="block";
            document.getElementById("usulan_kppn").style.display="block";
        }
    });
});